<template>
	<view>
		<uni-segmented-control :current="current" :values="['学员信息','回访试听']" @clickItem="onClickItem" styleType="text"
			activeColor="#4cd964"></uni-segmented-control>
		<view class="content">
			<view v-show="current === 0">				
				<uni-list>
					<uni-list-item title="基础信息" style="background-color:#bebdc3;"></uni-list-item>
					<uni-list-item title="学员编号:" :rightText="this.studentData.studentNumber"></uni-list-item>
					<uni-list-item title="学员姓名:" :rightText="this.studentData.studentName" ></uni-list-item>
					<uni-list-item title="手机号码:" :rightText="this.studentData.studentPhone" ></uni-list-item>
					<uni-list-item title="身份证号:" :rightText="this.studentData.studentIdNumber"></uni-list-item>
					<uni-list-item title="出生日期:" :rightText="this.studentData.studentBirthday"></uni-list-item>
					<uni-list-item title="备注" :rightText="this.studentData.note != null ? this.studentData.note:'未填写'"></uni-list-item>
				</uni-list>
				
				<uni-list style="margin-top: 20px;margin-bottom: 20px;">
					<uni-list-item title="紧急联系人" style="background-color:#bebdc3;" ></uni-list-item>
					<uni-list-item title="联系人关系:" :rightText="this.studentData.contactRelation != null ? this.studentData.contactRelation:'未填写'" ></uni-list-item>
					<uni-list-item title="联系人姓名:" :rightText="this.studentData.contactName  != null ? this.studentData.contactName:'未填写'"></uni-list-item>
					<uni-list-item title="联系人手机号:" :rightText="this.studentData.contactPhone  != null ? this.studentData.contactPhone:'未填写'"></uni-list-item>
				</uni-list>
				
				
				<uni-list  v-if="this.studentData.statusId == 1">
					<uni-list-item title="课程信息" style="background-color:#bebdc3;" ></uni-list-item>
					<uni-list-item :title="this.studentData.courseName != null?this.studentData.courseName:'暂未办理'" :rightText="this.studentData.courseName != null?'剩余课时'+this.studentData.courseHour+'h':'暂无'"></uni-list-item>
				</uni-list>
				
				
				<view style="display: flex;margin-top: 20px;margin-bottom: 20px;">
					<button style="width: 40%;color:#FFFFFF;background-color: #33BB44;">课程续费</button>
					<button style="width: 40%;color: #FFFFFF;background-color: #33BB44;">课程办理</button>
				</view>
			</view>
			<view v-show="current === 1">
				<view style="display: flex;margin-top: 20px;margin-bottom: 20px;">
					<button style="width: 40%">回访备注</button>
					<button style="width: 40%;color: #FFFFFF;background-color: #33BB44;">试听报名</button>
				</view>
			</view>

		</view>
	</view>
</template>

<script>
	import {oneStudnetByStudentId} from "../../../api/student.js"
	export default {
		data() {
			return {
				current: 0,
				studentId: null,
				studentData:{}
			}
		},
		onLoad(option) {
			this.studentId = option.studentId;
			this.getOneStudentStuData()


		},
		methods: {
			onClickItem(e) {
				this.current = e.currentIndex
			},
			getOneStudentStuData(){
				oneStudnetByStudentId(this.studentId).then(res => {
					console.log(res);
					this.studentData = res.data
				})
			}

		}
	}
</script>

<style>

</style>
